package com.neoharvest.smartagri.service;

import com.neoharvest.smartagri.command.MachineCommand;
import com.neoharvest.smartagri.model.AgriculturalMachine;

import java.util.ArrayList;
import java.util.List;

public class TaskManagementService {
    private List<MachineCommand> taskQueue = new ArrayList<>();
    
    public void createTask(MachineCommand command) {
        taskQueue.add(command);
        System.out.println("[系统提示] 新任务成功加入队列");
    }
    
    public void executeAllTasks() {
        System.out.println("[系统] 开始全任务执行序列...");
        taskQueue.forEach(MachineCommand::execute);
        taskQueue.clear();
    }
    
    public void sendRemoteCommand(AgriculturalMachine machine, String command) {
        System.out.println("Sending remote command '" + command + "' to machine");
        // 这里可以添加具体的命令处理逻辑
    }
    
    public void handleEmergency() {
        System.out.println("Emergency situation detected! Stopping all machines...");
        // 紧急处理逻辑
    }
}